module WindowedApp 
    (
     windowedApp
    ) where
    
import Graphics.UI.Gtk

windowedApp :: String -> IO Widget -> IO ()
windowedApp title action = do
  unsafeInitGUIForThreadedRTS
  window <- windowNew
  mainWidget <- action
  set window [windowDefaultWidth := 800, 
              windowDefaultHeight := 600,
              containerBorderWidth := 10, 
              windowTitle := title,
              containerChild := mainWidget]

  onDestroy window mainQuit
  widgetShowAll window
  mainGUI

